<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 应急响应中心管理系统</title>
    <link rel="stylesheet" th:href="@{/css/main.css}">
    <style>
        .login-container {
            max-width: 400px;
            margin: 100px auto;
            padding: 30px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .login-logo {
            text-align: center;
            margin-bottom: 30px;
        }
        .login-logo img {
            height: 60px;
        }
        .login-title {
            text-align: center;
            margin-bottom: 30px;
            color: #2c3e50;
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
        }
        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
        }
        .btn-login {
            width: 100%;
            padding: 12px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }
        .btn-login:hover {
            background-color: #2980b9;
        }
        .btn-login:disabled {
            background-color: #bdc3c7;
            cursor: not-allowed;
        }
        .login-footer {
            text-align: center;
            margin-top: 20px;
            color: #7f8c8d;
            font-size: 14px;
        }
        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 4px;
        }
        .alert-danger {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .alert-success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        .loading {
            display: none;
        }
        .loading.show {
            display: inline-block;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-logo">
            <img th:src="@{/images/ing1.png}" alt="ERCMS Logo">
        </div>
        <h2 class="login-title">应急响应中心管理系统</h2>
        
        <div id="alert-container"></div>
        
        <form id="loginForm">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名" required autofocus>
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required>
            </div>
            <button type="submit" class="btn-login" id="loginBtn">
                <span class="loading" id="loading">登录中...</span>
                <span id="loginText">登录</span>
            </button>
        </form>
        
        <div style="margin-top: 10px; text-align: center;">
            <button type="button" id="clearAuthBtn" style="background: none; border: none; color: #3498db; text-decoration: underline; cursor: pointer; font-size: 12px;">
                清除旧的登录信息
            </button>
        </div>
        
        <div style="margin-top: 20px; font-size: 14px; color: #777;">
            <p>可用账号:</p>
            <ul>
                <li>系统管理员: admin / 123456</li>
                <li>调度员: dispatcher / 123456</li>
                <li>响应员1: responder1 / 123456</li>
                <li>响应员2: responder2 / 123456</li>
                <li>部门经理: manager / 123456</li>
            </ul>
        </div>
        
        <div class="login-footer">
            &copy; 2025 应急响应中心管理系统 保留所有权利
        </div>
    </div>

    
    <script th:src="@{/js/auth.js}"></script>
    <script th:src="@{/js/login.js}"></script>
</body>
</html> 
